package com.chee.plant.hibernate.object.base;

import java.io.Serializable;

/**
 * This is an object that contains data related to the user table. Do not modify
 * this class because it will be overwritten if the configuration file related
 * to this class is modified.
 * 
 * @hibernate.class table="user"
 */

public abstract class BaseUser implements Serializable {

	public static String REF = "User";
	public static String PROP_MONEY = "Money";
	public static String PROP_TYPE = "Type";
	public static String PROP_NICK_NAME = "NickName";
	public static String PROP_PASSWORD = "Password";
	public static String PROP_CROP_EXP = "CropExp";
	public static String PROP_NAME = "Name";
	public static String PROP_STATUS = "Status";
	public static String PROP_LOGIN_IP = "LoginIp";
	public static String PROP_CREATED = "Created";
	public static String PROP_EMAIL = "Email";
	public static String PROP_PICTURE = "Picture";
	public static String PROP_LOGIN_TIME = "LoginTime";
	public static String PROP_GENDER = "Gender";
	public static String PROP_GOLD = "Gold";
	public static String PROP_ID = "Id";
	public static String PROP_CROP_LEVEL = "CropLevel";
	public static String PROP_CREATE_IP = "CreateIp";
	public static String PROP_USER_KEY = "UserKey";

	// constructors
	public BaseUser() {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseUser(java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseUser(java.lang.Integer id, java.lang.Integer type,
			java.lang.String name, java.lang.String password,
			java.lang.String userKey, java.lang.String nickName,
			java.lang.String email, java.lang.String picture,
			java.lang.Integer gender, java.lang.Integer cropExp,
			java.lang.Integer cropLevel, java.lang.Integer money,
			java.lang.Integer gold, java.util.Date created,
			java.lang.String createIp, java.util.Date loginTime,
			java.lang.String loginIp, java.lang.Integer status) {

		this.setId(id);
		this.setType(type);
		this.setName(name);
		this.setPassword(password);
		this.setUserKey(userKey);
		this.setNickName(nickName);
		this.setEmail(email);
		this.setPicture(picture);
		this.setGender(gender);
		this.setCropExp(cropExp);
		this.setCropLevel(cropLevel);
		this.setMoney(money);
		this.setGold(gold);
		this.setCreated(created);
		this.setCreateIp(createIp);
		this.setLoginTime(loginTime);
		this.setLoginIp(loginIp);
		this.setStatus(status);
		initialize();
	}

	//为查询用户的头像，种植经验和等级金币数量而设定的构造方法  
	public BaseUser(java.lang.String picture, java.lang.Integer cropExp,
			java.lang.Integer cropLevel, java.lang.Integer gold) {
		this.setPicture(picture);
		this.setCropExp(cropExp);
		this.setCropLevel(cropLevel);
		this.setGold(gold);
	}

	protected void initialize() {
	}

	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer type;
	private java.lang.String name;
	private java.lang.String password;
	private java.lang.String userKey;
	private java.lang.String nickName;
	private java.lang.String email;
	private java.lang.String picture;
	private java.lang.Integer gender;
	private java.lang.Integer cropExp;
	private java.lang.Integer cropLevel;
	private java.lang.Integer money;
	private java.lang.Integer gold;
	private java.util.Date created;
	private java.lang.String createIp;
	private java.util.Date loginTime;
	private java.lang.String loginIp;
	private java.lang.Integer status;

	/**
	 * Return the unique identifier of this class
	 * 
	 * @hibernate.id generator-class="sequence" column="id"
	 */
	public java.lang.Integer getId() {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * 
	 * @param id
	 *            the new ID
	 */
	public void setId(java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}

	/**
	 * Return the value associated with the column: type
	 */
	public java.lang.Integer getType() {
		return type;
	}

	/**
	 * Set the value related to the column: type
	 * 
	 * @param type
	 *            the type value
	 */
	public void setType(java.lang.Integer type) {
		this.type = type;
	}

	/**
	 * Return the value associated with the column: name
	 */
	public java.lang.String getName() {
		return name;
	}

	/**
	 * Set the value related to the column: name
	 * 
	 * @param name
	 *            the name value
	 */
	public void setName(java.lang.String name) {
		this.name = name;
	}

	/**
	 * Return the value associated with the column: password
	 */
	public java.lang.String getPassword() {
		return password;
	}

	/**
	 * Set the value related to the column: password
	 * 
	 * @param password
	 *            the password value
	 */
	public void setPassword(java.lang.String password) {
		this.password = password;
	}

	/**
	 * Return the value associated with the column: user_key
	 */
	public java.lang.String getUserKey() {
		return userKey;
	}

	/**
	 * Set the value related to the column: user_key
	 * 
	 * @param userKey
	 *            the user_key value
	 */
	public void setUserKey(java.lang.String userKey) {
		this.userKey = userKey;
	}

	/**
	 * Return the value associated with the column: nick_name
	 */
	public java.lang.String getNickName() {
		return nickName;
	}

	/**
	 * Set the value related to the column: nick_name
	 * 
	 * @param nickName
	 *            the nick_name value
	 */
	public void setNickName(java.lang.String nickName) {
		this.nickName = nickName;
	}

	/**
	 * Return the value associated with the column: email
	 */
	public java.lang.String getEmail() {
		return email;
	}

	/**
	 * Set the value related to the column: email
	 * 
	 * @param email
	 *            the email value
	 */
	public void setEmail(java.lang.String email) {
		this.email = email;
	}

	/**
	 * Return the value associated with the column: picture
	 */
	public java.lang.String getPicture() {
		return picture;
	}

	/**
	 * Set the value related to the column: picture
	 * 
	 * @param picture
	 *            the picture value
	 */
	public void setPicture(java.lang.String picture) {
		this.picture = picture;
	}

	/**
	 * Return the value associated with the column: gender
	 */
	public java.lang.Integer getGender() {
		return gender;
	}

	/**
	 * Set the value related to the column: gender
	 * 
	 * @param gender
	 *            the gender value
	 */
	public void setGender(java.lang.Integer gender) {
		this.gender = gender;
	}

	/**
	 * Return the value associated with the column: crop_exp
	 */
	public java.lang.Integer getCropExp() {
		return cropExp;
	}

	/**
	 * Set the value related to the column: crop_exp
	 * 
	 * @param cropExp
	 *            the crop_exp value
	 */
	public void setCropExp(java.lang.Integer cropExp) {
		this.cropExp = cropExp;
	}

	/**
	 * Return the value associated with the column: crop_level
	 */
	public java.lang.Integer getCropLevel() {
		return cropLevel;
	}

	/**
	 * Set the value related to the column: crop_level
	 * 
	 * @param cropLevel
	 *            the crop_level value
	 */
	public void setCropLevel(java.lang.Integer cropLevel) {
		this.cropLevel = cropLevel;
	}

	/**
	 * Return the value associated with the column: money
	 */
	public java.lang.Integer getMoney() {
		return money;
	}

	/**
	 * Set the value related to the column: money
	 * 
	 * @param money
	 *            the money value
	 */
	public void setMoney(java.lang.Integer money) {
		this.money = money;
	}

	/**
	 * Return the value associated with the column: gold
	 */
	public java.lang.Integer getGold() {
		return gold;
	}

	/**
	 * Set the value related to the column: gold
	 * 
	 * @param gold
	 *            the gold value
	 */
	public void setGold(java.lang.Integer gold) {
		this.gold = gold;
	}

	/**
	 * Return the value associated with the column: created
	 */
	public java.util.Date getCreated() {
		return created;
	}

	/**
	 * Set the value related to the column: created
	 * 
	 * @param created
	 *            the created value
	 */
	public void setCreated(java.util.Date created) {
		this.created = created;
	}

	/**
	 * Return the value associated with the column: create_ip
	 */
	public java.lang.String getCreateIp() {
		return createIp;
	}

	/**
	 * Set the value related to the column: create_ip
	 * 
	 * @param createIp
	 *            the create_ip value
	 */
	public void setCreateIp(java.lang.String createIp) {
		this.createIp = createIp;
	}

	/**
	 * Return the value associated with the column: login_time
	 */
	public java.util.Date getLoginTime() {
		return loginTime;
	}

	/**
	 * Set the value related to the column: login_time
	 * 
	 * @param loginTime
	 *            the login_time value
	 */
	public void setLoginTime(java.util.Date loginTime) {
		this.loginTime = loginTime;
	}

	/**
	 * Return the value associated with the column: login_ip
	 */
	public java.lang.String getLoginIp() {
		return loginIp;
	}

	/**
	 * Set the value related to the column: login_ip
	 * 
	 * @param loginIp
	 *            the login_ip value
	 */
	public void setLoginIp(java.lang.String loginIp) {
		this.loginIp = loginIp;
	}

	/**
	 * Return the value associated with the column: status
	 */
	public java.lang.Integer getStatus() {
		return status;
	}

	/**
	 * Set the value related to the column: status
	 * 
	 * @param status
	 *            the status value
	 */
	public void setStatus(java.lang.Integer status) {
		this.status = status;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof com.chee.plant.hibernate.object.User))
			return false;
		else {
			com.chee.plant.hibernate.object.User user = (com.chee.plant.hibernate.object.User) obj;
			if (null == this.getId() || null == user.getId())
				return false;
			else
				return (this.getId().equals(user.getId()));
		}
	}

	public int hashCode() {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId())
				return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":"
						+ this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}

	public String toString() {
		return super.toString();
	}

	private static final long serialVersionUID = 1L;
}